package com.calligraphy.user.web.controller;

import com.calligraphy.user.service.AttachmentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author hy
 * @Date 2018/12/27 12:59
 **/
@Slf4j
@RestController
@RequestMapping("/attachment")
public class AttachmentController {

    @Autowired
    private AttachmentService service;

    @RequestMapping("/upload")
    public String upload(@RequestParam(value = "file") MultipartFile file){
        return service.save(file);
    }
}
